package com.hdoit.kylin.web.baseInfo.modelconfig;

import com.hdoit.kylin.web.baseInfo.providers.SchoolIdProvider;
import com.tennetcn.common.enums.regular.RegularExpressions;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

public class AcademyConfig extends ModelMetadataAttributeConfiguration {
	public AcademyConfig() {
		this.setProperty("academyName")
			.hasAttribute(new DisplayNameAttribute("学院名"))
			.hasAttribute(new RequiredAttribute("学院名为必填项"));
		
		this.setProperty("schoolId")
			.hasAttribute(new DisplayNameAttribute("学校"))
			.hasAttribute(new DropDownListAttribute(new SchoolIdProvider()))
			.hasAttribute(new RequiredAttribute("学校为必填项"));
		
		this.setProperty("phone")
			.hasAttribute(new DisplayNameAttribute("电话"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.mobile));
		
		this.setProperty("address")
			.hasAttribute(new DisplayNameAttribute("地址"));
		
		this.setProperty("comments")
			.hasAttribute(new DisplayNameAttribute("描述"));
		
		this.setProperty("major")
			.hasAttribute(new DisplayNameAttribute("专业"));
		
		this.setProperty("homepage")
			.hasAttribute(new DisplayNameAttribute("主页"))
			.hasAttribute(new RequiredAttribute("主页为必填项"));
	}

}
